package jumpingnotes.security;

import java.io.Serializable;
import java.util.Calendar;

public class Session implements Serializable
{
	private String id;
	private String email;
	private Calendar expire;

	public Session()
	{
	}

	public Session(String id, String email, Calendar expire)
	{
		this.id = id;
		this.email = email;
		this.expire = expire;
	}

	public Session(String id, String email)
	{
		this(id, email, Calendar.getInstance());
	}

	@Override
	public String toString()
	{
		StringBuilder sb = new StringBuilder();
		sb.append("[Session] ID=").append(id);
		sb.append(", Email=").append(email);
		sb.append(", Expire=").append(expire.getTime());
		return sb.toString();
	}

	public String getId()
	{
		return id;
	}

	public void setId(String id)
	{
		this.id = id;
	}

	public String getEmail()
	{
		return email;
	}

	public void setEmail(String email)
	{
		this.email = email;
	}

	public Calendar getExpire()
	{
		return expire;
	}

	public void setExpire(Calendar expire)
	{
		this.expire = expire;
	}
}
